package com.sion.aspect;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;

/**
 * Aspect for Spring Load Time Weaving.
 * 
 * @author vivo
 * @date 2007-12-24
 */
@Aspect
public class DemoAspect {

	@Pointcut("execution(* com.sion.DemoAction.printABC(..))")
	public void abcPointcut() {
	}

	@Around("abcPointcut()")
	public void before(ProceedingJoinPoint pjp) {
		System.out.println("AROUND action: For LTW ");
		try {
			pjp.proceed();
		} catch (Throwable e) {
			e.printStackTrace();
		}
	}

	//
	// @AfterReturning(pointcut = "abcPointcut()", returning = "returnValue")
	// public void afterReturning(Object returnValue) throws Exception {
	// System.out.println("afterPropertiesSet");
	//
	// }
	//
	// @AfterThrowing(pointcut = "abcPointcut()", throwing = "ex")
	// public void afterThrowing(Throwable ex) throws Exception {
	// System.out.println("afterPropertiesSet");
	// }
	//
	// @After("abcPointcut()")
	// public void after(Throwable ex) throws Exception {
	// System.out.println("afterPropertiesSet");
	// }
	//
	// @Around("abcPointcut()")
	// public void around(ProceedingJoinPoint pjp) throws Exception {
	// try {
	// pjp.proceed();
	// } catch (Throwable e) {
	// e.printStackTrace();
	// }
	// System.out.println("afterPropertiesSet");
	// }

}
